package biz.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import dao.FolderDao;
import entity.Announce;
import entity.Folder;
import biz.FolderBiz;

public class FolderBizImpl implements FolderBiz {
	private FolderDao folderDao;
	public List<Folder> findByPage(Integer pageNo, Integer rows,Integer deptid) {
		Map map = new HashMap();
		map.put("start", (pageNo-1)*rows+1);
		map.put("end", pageNo*rows);
		map.put("deptid", deptid);
		return folderDao.findByPage(map);
	}
	public List<Folder> findByParam(Integer pageNo, Integer rows,Map map,Integer deptid) {
		map.put("start", (pageNo-1)*rows+1);
		map.put("end", pageNo*rows);
		map.put("deptid", deptid);
		return folderDao.findByParam(map);
	}
	
	
	public Integer count(Integer deptid) {
		return folderDao.count(deptid);
	}
	public Integer count(Map map,Integer deptid) {
		map.put("deptid", deptid);
		return folderDao.count1(map);
	}
	public FolderDao getFolderDao() {
		return folderDao;
	}

	public void setFolderDao(FolderDao folderDao) {
		this.folderDao = folderDao;
	}

	public List<Folder> findAll() {
		return folderDao.findAll();
	}

	public Folder findById(Integer id) {
		return folderDao.findById(id);
	}

	public int add(Folder folder) {
		return folderDao.add(folder);
	}

	public int delete(Folder folder) {
		return folderDao.delete(folder);
	}

	public int update(Folder folder) {
		return folderDao.update(folder);
	}

	

}
